/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package calculator.entities;

/**
 *
 * @author Mirek
 */
public class StringToEntityFactory implements IEntitesFactory{

    public IMathEntity getEntity(Object type, Object value) {
        if(type.toString().equals("IntegerNumber"))
            return produceIntegerNumber(value.toString());
        if(type.toString().equals("SuperBigNumber"))
            return produceSuperBigNumber(value.toString());
        return null;
    }

    private IMathEntity produceIntegerNumber(String value)
    {
        return new IntegerNumber(Integer.valueOf(value));
    }
    private IMathEntity produceSuperBigNumber(String value)
    {
        return null;
    }

}
